//
//  HXTInfoViewModel.m
//  HonlivApp
//
//  Created by admin on 2017/6/27.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "HXTInfoViewModel.h"

static NSString *const hxtInfo_url = @"api/Hxt/HxtInfo?HxtCardNo=";

@implementation HXTInfoViewModel

-(void)getHXTCardsInfo:(void (^)())completion{
    User *user = [User currentUser];
    NSString *url = [NSString stringWithFormat:@"%@%@%@",HOSPITAL_URL,hxtInfo_url,user.MedicalCard];
    [NetWorker getHXTDatasWithURLStr:url success:^(id result) {
        CardInfoModel *model = [CardInfoModel yy_modelWithJSON:result[@"result"]];
        _cardInfo = model;
        completion(model);
    } failure:^(id result) {
        [SVProgressHUD showErrorWithStatus:@"获取数据失败"];
    }];

}

@end
